import request from '@/utils/request'
// 获取全部report数据  图表
export const findCampaignTotal = (params) => {
  // (type, orgId, startTime, endTime, campaignId) 
  return request({
    // type:DAILY，HOURLY
    params: params,
    method: 'get',
    url: `comsumerReport/findCampaignTotal`
    // url: `comsumerReport/findCampaignTotal?type=${type}&orgId=${orgId}&startTime=${startTime}&endTime=${endTime}&campaignId=${campaignId}`
  })
}

// 获取单独campaign list数据
export const findCampaignList = (params) => {
  return request({
    // type:DAILY，HOURLY
    params: params,
    method: 'get',
    url: 'comsumerReport/findCampaignList'
  })
}
// adGroup report数据
export const findAdGroupTotal = (params) => {
	// export const findAdGroupTotal = (type, orgId, startTime, endTime, campaignId, adGroupId,) => {
  return request({
    // type:DAILY，HOURLY
	params: params,
    method: 'get',
    url: 'comsumerReport/findAdGroupTotal',
	// url: `comsumerReport/findAdGroupTotal?type=${type}&orgId=${orgId}&startTime=${startTime}&endTime=${endTime}&campaignId=${campaignId}&adGroupId=${adGroupId}`
  })
}
// 获取单独adGroup list数据
export const findAdGroupList = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findAdGroupList'
  })
}
// 获取单独Keyword Total数据
export const findKeywordTotal = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findKeywordTotal'
  })
}

// 获取单独Keyword List数据
export const findKeywordList = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findKeywordList'
  })
}

// 获取单独Campaign ListTotal数据
export const findCampaignListTotal = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findCampaignListTotal'
  })
}

// 获取单独AdGroup ListTotal数据
export const findAdGroupListTotal = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findAdGroupListTotal'
  })
}

// 获取单独Keyword ListTotal数据
export const findKeywordListTotal = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findKeywordListTotal'
  })
}
// 获取单独搜索詞 List数据
export const findSearchTermList = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findSearchTermList'
  })
}
// 获取单独搜索詞 ListTotal数据
export const findSearchTermListTotal = (params) => {
  return request({
    // type:DAILY，HOURLY
    params,
    method: 'get',
    url: 'comsumerReport/findSearchTermListTotal'
  })
}
// 全部广告计划数据下载
export const downloadCampaignCsv = (params) => {
  return request({
    params,
    method: 'get',
    responseType: 'Blob',
    url: 'comsumerReport/downloadCampaignCsv'
  })
}
// 全部广告组数据下载
export const downloadAdGroupCsv = (params) => {
  return request({
    params,
    method: 'get',
    responseType: 'Blob',
    url: 'comsumerReport/downloadAdGroupCsv'
  })
}
// 全部关键词数据下载
export const downloadKeywordCsv = (params) => {
  return request({
    params,
    method: 'get',
    responseType: 'Blob',
    url: 'comsumerReport/downloadKeywordCsv'
  })
}
// 全部否定关键词数据下载
export const downloadNegativeKeyWordsCsv = (params) => {
  return request({
    params,
    method: 'get',
    url: 'comsumerNegativeKeyWords/downloadNegativeKeyWordsCsv'
  })
}
// 全部搜索词数据下载
export const downloadSearchTermCsv = (params) => {
  return request({
    params,
    method: 'get',
    responseType: 'Blob',
    url: 'comsumerReport/downloadSearchTermCsv'
  })
}
// 历史关键词初加
export const findBidRecordList = (params) => {
  return request({
    params,
    method: 'get',
    url: 'comsumerKeyWords/findBidRecordList'
  })
}
